package com.pureut.system.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pureut.system.domain.MesRepairManagement;
import com.pureut.system.domain.vo.MesRepairManagementVo;
import com.pureut.system.mapper.MesRepairManagementMapper;
import com.pureut.system.service.IMesRepairManagementService;
import org.apache.catalina.security.SecurityUtil;
import org.springframework.stereotype.Service;
import java.util.Date;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import javax.annotation.Resource;

/**
 * @Author: pureut
 * @Date: 2025-04-08 11:15:55
 * @Desc: MES维修管理表
 */
@Service("mesRepairManagementService")
public class MesRepairManagementServiceImpl extends ServiceImpl<MesRepairManagementMapper, MesRepairManagement> implements IMesRepairManagementService {

    /**
     * MES维修管理表Dao
     */
    @Resource
    private MesRepairManagementMapper mesRepairManagementMapper;


    /**
     * 新增MES维修管理表
     * @param mesRepairManagementVo
     * @return
     */
    @Override
    public Boolean save(MesRepairManagementVo mesRepairManagementVo) {
        MesRepairManagement mesRepairManagement = new MesRepairManagement();
        BeanUtil.copyProperties(mesRepairManagementVo, mesRepairManagement);
        mesRepairManagement.setCreateTime(new Date());
        return save(mesRepairManagement);
    }


    /**
     * 更新MES维修管理表
     * @param mesRepairManagementVo
     * @return
     */
    @Override
    public Boolean updateById(MesRepairManagementVo mesRepairManagementVo) {
        MesRepairManagement mesRepairManagement = new MesRepairManagement();
        BeanUtil.copyProperties(mesRepairManagementVo, mesRepairManagement);
        return updateById(mesRepairManagement);
    }
}
